# for-in.py
'''
    循环：更适合去遍历一些数据

    for 临时遍历 in 待处理得数据集:
        执行得代码块
'''
str ='hellword!'
for x in str:
    print(x) # x就是遍历出来得元素
list = ['张闻','刘文峰','成光','泽华']
i = 0
list.append('漳卅')
while i<len(list):
    print(list[i])
    i+=1
# for in 
for x in list:
    print(x)


# 统计一个字符串里面会有几个a
name = 'aadsadkawfnefafnaffafkdfnsdfnd'
index=0
for x in name:
    if x=='a':
        index+=1
print(f'name中有{index}个a')


# for in 输出0-10
for a in range(11):
    print(a)
# 输出1-10 range(开始,截止)
for a in range(1,11): 
    print(a)

# range(开始,截止,步长)
for a in range(6,101,6):
    print(a)


# 把while循环乘法口诀表改成for in
